<template>
<a-card :bordered="false">
    <div class="table-operator">
        <a-button shape="round" size="small" type="primary" icon="plus" @click="handleEdit({},'drForm','新增')">添加</a-button>
    </div>

    <LTable
        ref="drList"
        size="middle"
        rowKey="keyId"
        :columns="columns"
        :formAttributes="formAttributes"
        axiosUrl="/SysDrController/page"
        :showPagination="true"
        :showQueryForm="true"
      
      >
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record,'drForm','详情')">编辑</a>
          <a-divider type="vertical"/>
          <a @click="handleEdit(record,'drRoleRuleList','角色规则详情')"><a-icon type="setting" />角色规则配置</a>
          <a-divider type="vertical" />
          <a @click="handleEdit(record,'drEmpRuleList','人员规则详情')"><a-icon type="setting" />人员规则配置</a>
          <a-divider type="vertical" />
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete({keyId:record.keyId,drNo:record.drNo},'/SysDrController/del','drList')">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </LTable>
      <drForm ref="drForm" @close="refresh('drList')" @ok="refresh('drList')"></drForm> 
      <drRoleRuleList ref="drRoleRuleList" ></drRoleRuleList>
      <drEmpRuleList ref="drEmpRuleList"></drEmpRuleList>
</a-card>
    
</template>

<script>
import LTable from '@/components/lt/LTable'
import {SysMixin} from '@/mixins/SysMixin'
import drForm from './drForm'
import drRoleRuleList from './drRoleRuleList'
import drEmpRuleList from './drEmpRuleList'
export default {
    name:'drList',
    components: {
        LTable,drForm,drRoleRuleList,drEmpRuleList
    },
    mixins:[SysMixin],
    data(){
        return{
          systemNo:'',
            dictTableSelectedRowKeys:[],
            formAttributes:[
                {field:'drName',label:'数据权限名称',component:'input',condition:'like'},
                {field:'drNo',label:'数据权限编号',component:'input',condition:'like'},
               
            ],

            
            columns:[
                {
                    title: '序号',
                    dataIndex: '',
                    key:'rowIndex',
                    width:60,
                    align:"center",
                    customRender:function (t,r,index) {
                      return parseInt(index)+1;
                    }
                },
               
                {
                  title: '数据权限名称',
                  dataIndex: 'drName'
                    
                },
                {
                  title: '数据权限编号',
                  dataIndex: 'drNo', 
                },
                
                {
                  title: '操作',
                  dataIndex: 'action',
                  width: '350px',
                  scopedSlots: { customRender: 'action' }
                }
            ],

           

        }
    },
    methods:{
    }
    
}
</script>